﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NLogInfo
{
    /// <summary>
    /// 格式化输出样式
    /// </summary>
    public class LogFormat
    {
        public static string ErrorFormat(LogMessage logMessage)
        {
            StringBuilder strInfo = new StringBuilder();
            strInfo.Append(" \r\n"+"操作时间: " + logMessage.OperationTime + " \r\n");
            strInfo.Append("操作人：" + logMessage.OperationName + " \r\n");
            strInfo.Append("请求地址：" + logMessage.IpAddress + "\r\n");
            strInfo.Append("错误内容：" + logMessage.LogInfo + "\r\n");
            strInfo.Append("跟踪信息：" + logMessage.StackTrace + "\r\n");
            strInfo.Append("-----------------------------------------------------------------------------------------------------------------------------\r\n");
            return strInfo.ToString();
        }
    }
}
